$emoji: () !default;
$emoji: map-merge(
    (
        textEmojiColor: #666,
        bg: #fff,
        borderColor: #e1e1e1,
        hoverBg: #f8f8f8,
        hoverBorderColor: #140b0b,
        fontEmojiSize: 14px,
    ),
    $emoji
);

$textEmojiColor: map-get($emoji, textEmojiColor);
$bg: map-get($emoji, bg);
$borderColor: map-get($emoji, borderColor);
$hoverBg: map-get($emoji, hoverBg);
$hoverBorderColor: map-get($emoji, hoverBorderColor);
$fontEmojiSize: map-get($emoji, fontEmojiSize);

.qaq-btn {
    user-select: none;
    cursor: pointer;
}

.qaq-wrap {
    display: none;
    position: absolute;
    top: 34px;
    left: -4%;
    padding: 8px;
    background-color: $bg;
    border: 1px solid $borderColor;
    border-radius: 4px;
    width: 500px;
    max-width: 283px;
    z-index: 3;
    // inset: auto auto 0px 0px;
    &::before,
    &::after {
        position: absolute;
        content: '';
        margin: 0;
        width: 0;
        height: 0;
    }
    &:after {
        top: -9px;
        left: 14px;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-bottom: 8px solid $borderColor;
    }
    &::before {
        top: -8px;
        left: 14px;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-bottom: 8px solid $bg;
        z-index: 1;
    }
}

.emoji-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    font-size: $fontEmojiSize;

    .emoji-item {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 4px 6px;
        color: $textEmojiColor;
        cursor: pointer;
        box-sizing: border-box;
        border: 1px solid transparent;
        border-radius: 4px;
        user-select: none;
        img.emoji {
            width: 20px;
            height: 20px;
        }
        &:hover {
            background-color: $hoverBg;
            border-color: $hoverBorderColor;

            & > .emoji {
                transform: scale(1.2);
                transition: transform 0.15s cubic-bezier(0.2, 0, 0.13, 2);
            }
        }
    }
    &::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    &::-webkit-scrollbar-corner {
        background-color: transparent;
    }
    &::-webkit-scrollbar-thumb {
        background-color: #d2cfcf;
        border-radius: 4px;
    }
    &::-webkit-scrollbar-track {
        background-color: transparent;
    }
}

.qaq-mask {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    display: block;
    cursor: default;
    content: ' ';
    background: transparent;
    z-index: -1;
}

.anim-scale-in {
    animation-name: scale-in;
    animation-duration: 0.15s;
    animation-timing-function: cubic-bezier(0.2, 0, 0.13, 1.5);
}

@keyframes scale-in {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}
